<!--
var sliderGroup = new Array();
var sliderHeader = new Array();
var sliderBody = new Array();
//var sliderArrows = new Array();
var sliderRoot = document.getElementById("Slider");
var oToggleSlider = null;
var dnum=0;
initSlider = function () {
	
	if (!document.getElementById) {
		callErrMsgWin("Your browser is too old to support the acoordion animation.");
		return false;
	}

	for (i=0, a=0; a < sliderRoot.childNodes.length; a++) {
		
		if(sliderRoot.childNodes[a].tagName == "DIV" && sliderRoot.childNodes[a].hasChildNodes){
			
			for (b = 0; b < sliderRoot.childNodes[a].childNodes.length; b++) {
				
				if(sliderRoot.childNodes[a].childNodes[b].tagName== "DIV" && sliderRoot.childNodes[a].childNodes[b].className){
				
					if (sliderRoot.childNodes[a].childNodes[b].className == "SliderHeader"){
						
						sliderHeader[i] = sliderRoot.childNodes[a].childNodes[b];
						sliderHeader[i].style.backgroundImage = "url(/images_0701/rank_a_2.gif)";
						//sliderArrows[i] = sliderHeader[i].getElementsByTagName("img")[0];
						//sliderArrows[i].setAttribute("src", "/images_0701/more.gif");
						sliderHeader[i].id = i;
						
					}
					else if (sliderRoot.childNodes[a].childNodes[b].className == "SliderBody"){
					
						sliderBody[i] = sliderRoot.childNodes[a].childNodes[b];
						if(dnum==0)
						{
							sliderBody[0].style.display = "block";
							sliderBody[0].style.height = "220px";
							dnum = 1;
						}else{
							sliderBody[i].style.display = "none";
							sliderBody[i].style.height = "0px";
						}
						i++;
					}
				}
			}
		}
	}
	
	sliderHeader[0].style.backgroundImage = "url(/images_0701/rank_a_1.gif)";
	
	oToggleSlider = new toggleSlider();
	preShowAccordion();
	addEventsHandler();

}

function addEventsHandler(){
	for(i = 0; i < sliderHeader.length; i++){
		/***Assign event handeler to each slide headers.***/
		sliderHeader[i].onmouseover = function(){

			if(oToggleSlider.isAnimationBusy){
				oToggleSlider.nextSlideToExpand = this.id;
			}
			else{
				oToggleSlider.slideToExpand = this.id;
				oToggleSlider.accordionStarter();
			}
			
		}
		sliderHeader[i].onclick = function(){

			if(oToggleSlider.isAnimationBusy){
				oToggleSlider.nextSlideToExpand = this.id;
			}
			else{
				oToggleSlider.slideToExpand = this.id;
				oToggleSlider.accordionStarter();
			}
			
		}
		sliderHeader[i].onmouseout = function(){
			oToggleSlider.nextSlideToExpand = null;
		}
	}
}

function preShowAccordion(){
	if(!oToggleSlider.isAnimationBusy){
		oToggleSlider.slideToExpand = oToggleSlider.defaultSlide;
		oToggleSlider.accordionStarter();
	}	
}

function toggleSlider() {
	
	/***Accordion animation parameters***/
	this.slidingSpeed = 20*2-5; //Speed, pixel moved per milliseond
	this.slidingAcceleration = 2.5;
	this.slideBodyHeight = 225; //Slide body height,  must be integer times of the speed.
	this.collapsedSlideHeight = 0; //Slide height when collapsed.
	this.slideToExpand = null;
	this.slideToCollapse = null;
	this.nextSlideToExpand = null;
	
	this.defaultSlide = 0; //The slide expaned by default
	this.isAnimationBusy = false;

}

toggleSlider.prototype.accordionStarter = function(){
	
	this.sliderFinder();
	
	if(this.nextSlideToExpand != null){
		this.slideToExpand = this.nextSlideToExpand;
	}
	
	if(this.slideToExpand == null){
		return;
	}
	
	if(this.slideToExpand < 0 || this.slideToExpand > sliderBody.length){
		return;
	}
	
	if (sliderBody[this.slideToExpand].style.display == "none" && this.isAnimationBusy == false){//Toggle slides only when the slide clicked is collapsed.
	
		sliderBody[this.slideToExpand].style.display = "block";
		this.isAnimationBusy = true;
		this.dynExpandHeight = this.collapsedSlideHeight;
		this.dynCollapseHeight = this.slideBodyHeight;
		timerExpand = window.setInterval(this.letsGo,40);
		
		return true;
	}
	else {
		
		return false;
		
	}
}

toggleSlider.prototype.letsGo = function(){
	
	var iSpeed;
	
	if (oToggleSlider.dynExpandHeight <= oToggleSlider.slideBodyHeight*0.5){
		iSpeed = oToggleSlider.slidingSpeed;
	}
	else if (oToggleSlider.dynExpandHeight >= oToggleSlider.slideBodyHeight*0.5 && (oToggleSlider.slideBodyHeight - oToggleSlider.dynExpandHeight) >= 8){
		iSpeed = Math.ceil(oToggleSlider.slidingSpeed/oToggleSlider.slidingAcceleration);
	}
	else if (oToggleSlider.dynExpandHeight >= oToggleSlider.slideBodyHeight*0.7 && (oToggleSlider.slideBodyHeight - oToggleSlider.dynExpandHeight) <= 3){
		iSpeed = 1;
	}
	else{
		iSpeed = 1;
	}
	
	oToggleSlider.dynExpandHeight = oToggleSlider.dynExpandHeight + iSpeed;
	oToggleSlider.dynCollapseHeight = oToggleSlider.dynCollapseHeight - iSpeed;
	
	if(oToggleSlider.slideToCollapse != null){
		sliderBody[oToggleSlider.slideToCollapse].style.height = oToggleSlider.dynCollapseHeight + "px";
	}
	sliderBody[oToggleSlider.slideToExpand].style.height = oToggleSlider.dynExpandHeight + "px";
		
	if(oToggleSlider.dynExpandHeight >= oToggleSlider.slideBodyHeight){

		clearInterval(timerExpand);
		if(oToggleSlider.slideToCollapse != null){
			sliderBody[oToggleSlider.slideToCollapse].style.display = "none";
		}
		
		//sliderArrows[oToggleSlider.slideToExpand].setAttribute("src", "/images_0701/more.gif");
		//if(oToggleSlider.slideToCollapse != null){
		//	sliderArrows[oToggleSlider.slideToCollapse].setAttribute("src", "/images_0701/more.gif");
		//}
		oToggleSlider.isAnimationBusy = false;
		
		if(oToggleSlider.nextSlideToExpand != null){
			oToggleSlider.accordionStarter();
		}
	}
	
	
}

toggleSlider.prototype.sliderFinder = function(){
	
	for (i=0; i<sliderBody.length; i++) {

		if (sliderBody[i].style.display == "block"){

			this.slideToCollapse = i;
			
		}
		
	}
}

function callErrMsgWin(errMsg){
	alert(errMsg);
}

window.onload = initSlider;//Initialize sections, everything starts from here.
// -->